package com.whut.mapper;


import com.whut.model.MachineInfo;
import com.whut.v_dataMap.EquipAssessDataMap.*;
import com.whut.v_vo.EquipRiskNumVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Component
public interface MachineinfoMapper {

    /**
     * mybatis-generator生成的方法
     */
    MachineInfo selectByPrimaryKey(Integer mKey);
    int deleteByPrimaryKey(Integer mKey);
    int insert(MachineInfo record);
    int insertSelective(MachineInfo record);
    int updateByPrimaryKeySelective(MachineInfo record);
    int updateByPrimaryKey(MachineInfo record);


    /**
     * @author: liukang
     * @Description: 插入，isDelete，isChecked默认存为N
     * @date: 2020/7/22 12:05
     * @param: 
     * @return: 
     */
    int insertN(MachineInfo record);

    /**
     * @author: liukang
     * @Description: 取表中所有信息
     * @date: 2020/7/22 12:20
     * @param:
     * @return:
     */
    List<MachineInfo> getAllMachine();

    /**
     * @author: liukang
     * @Description: 根据mKey查询信息，只查询isDelete字段为N的
     * @date: 2020/7/22 12:29
     * @param:
     * @return:
     */
    MachineInfo selectByPrimaryKeyN(Integer mKey);

    /**
     * @author: liukang
     * @Description: 根据搜索参数取数据
     * @date: 2020/7/22 12:21
     * @param:
     * @return:
     */
    List<MachineInfo> getMachineInfoBySearchParams(String searchParams);

    /**
     * @author: liukang
     * @Description: 根据工程id查询信息
     * @date: 2020/7/22 12:23
     * @param:
     * @return:
     */
    List<MachineInfo> getMachineInfoByProjectId(Integer projectId);

    /**
     * @author: liukang
     * @Description: 根据工程id和设备类型查询信息
     * @date: 2020/7/22 12:26
     * @param:
     * @return:
     */
    List<MachineInfo> getMachineInfoByEquipType(Integer projectId,Integer machineType);

    List<MachineInfo> getAllByProjectIdAndEquipType( Integer projectId,  Integer equipType);

    List<String> getEquipNumByCurNum(int projectId,int curNumber);


    /**
     * LK 报告
     */
    List<sbzxPart2Seg1Map> getEquipNumberInfo(int projectId);
    List<jcqkPart2Seg3Map> getEquipUnitInfo(int projectId);
    List<jcqkPart2Seg3Inner2Map> getEquipRiskNum(int checkId,int projectId);
    EquipRiskNumVO getEquipRiskNumSum(int checkId,int projectId);
    List<wthzPart3Map> getEquipProblemInfo(int checkId,int projectId);
    List<glgjPart4Map> getProblemSuggestionInfo(int projectId);
    List<glgjPart4Map> getProblemSummaryInfo(int checkId,int projectId);
    List<section2Map> getEquipCheckResultInfo(int checkId,int projectId);



    List<MachineInfo> getMachineInfoRecordByProjectId(int projectId);

    List<Map<String, String>> getTypeNameList(String projectId);

    List<Map<String, String>> getEquipNameList(String projectId, String equipType);

    /**
     * Author:yjh
     * Description:返回所查所有设备信息
     * Create date:2021/3/8 12:54
     * Param:[【]String project]
     * Return:com.whut.model.MachineInfo
     * Modify[]:,,
     */
    List<MachineInfo> getEquipTypeByProjectId(@Param("projectId")int projectId);

    MachineInfo getAllByProjectIdAndEquipNum (int projectId,String equipNum);

    List<String> getEquipNUmByProjectIdAndEquipType (int projectId, int equipType);
}